package one.stand.service.user;

import com.google.common.collect.Lists;
import one.stand.dto.MenuTreeDto;
import one.stand.model.Menu;

import java.util.List;

public interface MenuService {

    /**
     * 根节点ID
     */
    int PARENT_ID = 0;

    /**
     * 类型：0后管 1 crm app 2 CRM pc 3 经销商App 4crmApp(新版)
     */
    int TYPE_ADMIN = 0;
    int TYPE_CRM_APP = 1;
    int TYPE_CRM_PC = 2;
    int TYPE_JXS_APP = 3;
    int TYPE_CRN_APP_NEW = 4;

    /**
     * 员工默认权限
     */
    List<String> INIT_CRM_APP = Lists.newArrayList("splb", "dllb", "tjyg", "cphb", "ptcpfx", "dlcpfx");
    List<String> INIT_JXS_APP = Lists.newArrayList("splb", "dllb", "tjyg", "cphb", "ptcpfx", "dlcpfx");

    // 初始化
    void initCrm(Integer userId, boolean isAdmin);

    void saveAdminRole(Integer adminId, Integer[] roleIds);

    void remove(Integer userId);

    // 更新
    void update(Integer userId, List<Integer> menuIds, boolean isOpen);

    void update(Integer userId, List<Integer> menuIds);

    List<MenuTreeDto> getAll(Integer menuId, Integer menuType);

    List<Menu> getOpenMenu(Integer userId, Integer type);

    List<Integer> getOpen(Integer userId);
}
